package com.xr.miniprogram.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.xr.miniprogram.mapper.MiniProgramDescriptionMapper;
import com.xr.miniprogram.domain.MiniProgramDescription;
import com.xr.miniprogram.service.IMiniProgramDescriptionService;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;

/**
 * 服务说明Service业务层处理
 *
 * @author wls
 * @date 2023-10-16
 */
@Service
public class MiniProgramDescriptionServiceImpl implements IMiniProgramDescriptionService
{
    @Resource
    private MiniProgramDescriptionMapper miniProgramDescriptionMapper;

    /**
     * 查询服务说明
     *
     * @param descriptionId 服务说明主键
     * @return 服务说明
     */
    @Override
    public MiniProgramDescription selectMiniProgramDescriptionByDescriptionId(Long descriptionId)
    {
        return miniProgramDescriptionMapper.selectMiniProgramDescriptionByDescriptionId(descriptionId);
    }

    /**
     * 查询服务说明列表
     *
     * @param miniProgramDescription 服务说明
     * @return 服务说明
     */
    @Override
    public List<MiniProgramDescription> selectMiniProgramDescriptionList(MiniProgramDescription miniProgramDescription)
    {
        return miniProgramDescriptionMapper.selectMiniProgramDescriptionList(miniProgramDescription);
    }

    /**
     * 新增服务说明
     *
     * @param miniProgramDescription 服务说明
     * @return 结果
     */
    @Override
    @Transactional(rollbackFor = Exception.class)
    public int insertMiniProgramDescription(MiniProgramDescription miniProgramDescription)
    {
        return miniProgramDescriptionMapper.insertMiniProgramDescription(miniProgramDescription);
    }

    /**
     * 修改服务说明
     *
     * @param miniProgramDescription 服务说明
     * @return 结果
     */
    @Override
    @Transactional(rollbackFor = Exception.class)
    public int updateMiniProgramDescription(MiniProgramDescription miniProgramDescription)
    {
        return miniProgramDescriptionMapper.updateMiniProgramDescription(miniProgramDescription);
    }

    /**
     * 批量删除服务说明
     *
     * @param descriptionIds 需要删除的服务说明主键
     * @return 结果
     */
    @Override
    @Transactional(rollbackFor = Exception.class)
    public int deleteMiniProgramDescriptionByDescriptionIds(Long[] descriptionIds)
    {
        return miniProgramDescriptionMapper.deleteMiniProgramDescriptionByDescriptionIds(descriptionIds);
    }

    /**
     * 删除服务说明信息
     *
     * @param descriptionId 服务说明主键
     * @return 结果
     */
    @Override
    @Transactional(rollbackFor = Exception.class)
    public int deleteMiniProgramDescriptionByDescriptionId(Long descriptionId)
    {
        return miniProgramDescriptionMapper.deleteMiniProgramDescriptionByDescriptionId(descriptionId);
    }
}
